import {Injectable} from '@angular/core';
import {BaseHttpService} from "../base-http.service";
import {Observable} from "rxjs";

export interface MajorHazardSourcesAddEdit {
  id?: number;
  dangerMatterKey: string;
  dangerType: string;
  symbol: string;
  beta: string;
  thresholdQuantity: string;
}

@Injectable({
  providedIn: 'root'
})
export class MajorHazardSourcesService {

  constructor(public http: BaseHttpService) {
  }

  editMajorHazardSources(param: MajorHazardSourcesAddEdit): Observable<void> {
    return this.http.put('/identify/danger', param, {needSuccessInfo: true});
  }

  getMajorHazardSourcesDetail(id: number): Observable<MajorHazardSourcesAddEdit> {
    return this.http.get(`/identify/danger/${id}`)
  }

}
